import java.util.Scanner;
class Point {
public Point(){
	System.out.print("Enter x coordinate");
	boolean op;
	Scanner sc = new Scanner(System.in);
	do {
	op = false;
		if(sc.hasNextDouble()){
			x = sc.nextDouble();
		}else{
			System.out.print("You enter not a number");
			op = true;
		}		
	}while (op);
	
	System.out.print("Enter y coordinate");
	do {
	op = false;
		if(sc.hasNextDouble()){
			y = sc.nextDouble();
		}else{
			System.out.print("You enter not a number");
			op = true;
		}		
	}while (op);
}
public Point(double a, double b){
	x = a;
	y = b;
}
public double lenght(Point p1,Point p2){
	double l;
	l=Math.sqrt(Math.pow(p1.x - p2.x, 2)+Math.pow(p1.y - p2.y,2));
	return l;
}
public static boolean inLine(Point p1, Point p2, Point p3){
	boolean in;
	in = (p1.x - p2.x)/(p3.x - p2.x) == (p1.y - p2.y)/(p3.y - p2.y);
	return in;
}
public void vectPlus(Point a){
	this.x += a.x;
	this.y += a.y;
}
public void vectMinus(Point a){
	this.x -= a.x;
	this.y -= a.y;
}
public void toPolar(){
	double r, fi;
	fi = 0;
	r = Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2));
	if(this.x > 0 && this.y >= 0){
		fi = Math.atan(this.y/this.x);
		}else{
	if(this.x > 0 && this.y < 0){
		fi = Math.atan(this.y/this.x) + 2*Math.PI;
		}else{
	if(this.x<0){
		fi = Math.atan(this.y/this.x) + Math.PI;
		}else{
	if(this.x == 0 && this.y > 0){
		fi = Math.PI/2;
		}else{
	if(this.x == 0 && this.y < 0){
		fi = 3*Math.PI/2;
		}else{
	if(this.x == 0 && this.y == 0){
		fi = 0;
		}
		}
		}
		}
		}
	}
	x = r;
	y = fi;
}
public void toDecart(){
	double r;
	r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
	x = r*Math.cos(y);
	y = r*Math.sin(y);
}
public void addAngle(double alpha){
	this.y += alpha;
}
	protected double x;
	protected double y;
}
class Triangle{
public Triangle(){
	boolean li;
	do{		
		li = false;
		System.out.println("Enter a coords");
		Point a = new Point();
		System.out.println("Enter b coords");
		Point b = new Point();
		System.out.println("Enter c coords");
		Point c = new Point();
			if(Point.inLine(a,b,c)){
				li = true;
				System.out.println("All points are in line");
			}
	} while(li);
}
public void rotateTriangle(double deg){
	Point m = new Point((a.x+b.x+c.x)/3,(a.y+b.y+c.y)/3);
	a.vectMinus(m);
	b.vectMinus(m);
	c.vectMinus(m);
	a.toPolar();
	b.toPolar();
	c.toPolar();
	a.addAngle(deg);
	b.addAngle(deg);
	c.addAngle(deg);
	a.toDecart();
	b.toDecart();
	c.toDecart();
	a.vectPlus(m);
	b.vectPlus(m);
	c.vectPlus(m);
}
private Point a;
private Point b;
private Point c;
}

public class tri {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
